package scau.zhong.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import scau.zhong.common.page.PageResult;
import scau.zhong.pojo.Person;
import java.util.List;


@FeignClient(value = "population-service")
public interface PersonService {

    @RequestMapping(value = "/person/all",method = RequestMethod.GET)
    List<Person> getAll();

    @RequestMapping(value = "/person/{id}",method = RequestMethod.GET)
    Person findById(@PathVariable String id);

    @RequestMapping(value = "/person/insert",method = RequestMethod.POST)
    void insert(Person person);

    @RequestMapping(value = "/person/update",method = RequestMethod.PUT)
    void update(Person person);

    @RequestMapping(value = "/person/delete",method = RequestMethod.DELETE)
    int deleteById(String id);

    @RequestMapping(value = "/person/page",method = RequestMethod.GET)
    PageResult<Person> queryByPage(String key, Integer page, Integer rows);

}
